package com.zyx.inputStream;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo3 {
    public static void main(String[] args) {
        FileInputStream fis=null;
        File file = new File("F:\\nsdJava\\java0720.txt");
        try {
            fis = new FileInputStream(file);

            byte[] b = new byte[1024];
            fis.read(b, 0, 1024);

            System.out.println(new String(b));

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }catch (IOException e) {
            e.printStackTrace();
        }finally{
            if(fis!=null){
                try {
                    fis.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }



    }
}
